﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Input;
using Microsoft.Practices.Prism.Regions;
using Microsoft.Practices.Unity;
using Microsoft.Practices.ServiceLocation;
using ShellInfrastructure;
using ModuleAddPlace.Views;


namespace ShopShell.PlaceCommands
{
    public class AddPlaceCommand : ICommand
    {
        [Dependency]
        public IRegionManager RegionManager { get; set; }

        public bool CanExecute(object parameter)
        {
            return true;
        }

        public event EventHandler CanExecuteChanged;

        public void Execute(object parameter)
        {
            RegionManager = ServiceLocator.Current.GetInstance<IRegionManager>();

            IRegion region = RegionManager.Regions[RegionNames.RightRegionName];
            region.Activate(ServiceLocator.Current.GetInstance<IAddPlaceView>());
        }
    }
}
